namespace OneWorks.Utils.FluentData
{
    using System.Data;
    using System.Data.Common;

    internal class ConnectionFactory
    {
        public static IDbConnection CreateConnection(string providerName, string connectionString)
        {
            var factory = DbProviderFactories.GetFactory(providerName);

            var connection = factory.CreateConnection();
            connection.ConnectionString = connectionString;
            return connection;
        }
    }
}